package jtk.project4.fleet;

import java.sql.SQLException;

import jtk.project4.fleet.domain.Vendor;
import jtk.project4.fleet.event.AccidentEntryEvent;

import jtk.project4.fleet.event.AddCustomerEvent;
import jtk.project4.fleet.event.AddEditFuelEntryEvent;
import jtk.project4.fleet.event.AddEditPartToPurchaseOrderEvent;
import jtk.project4.fleet.event.AddEditPurchaseOrderEvent;
import jtk.project4.fleet.event.AddFluidConsumedEvent;
import jtk.project4.fleet.event.AddGeneralExpenseEvent;
import jtk.project4.fleet.event.AddMaintenanceTaskEvent;
import jtk.project4.fleet.event.AddNewCategoryEvent;
import jtk.project4.fleet.event.AddNewFuelTankEvent;
import jtk.project4.fleet.event.AddNewLocationEvent;
import jtk.project4.fleet.event.AddPartUsedEvent;
import jtk.project4.fleet.event.AddPaymentEvent;
import jtk.project4.fleet.event.AdjustInventoryForPartEvent;
import jtk.project4.fleet.event.AdvancedOptionsEvent;
import jtk.project4.fleet.event.AutoGeneratePOEvent;
import jtk.project4.fleet.event.BrowsePaymentsEvent;
import jtk.project4.fleet.event.BrowsePurchaseOrdersEvent;
import jtk.project4.fleet.event.CostStatisticEvent;
import jtk.project4.fleet.event.CustomerManagementEvent;
import jtk.project4.fleet.event.EditCompanyNameEvent;
import jtk.project4.fleet.event.EditMaintenanceTaskEvent;
import jtk.project4.fleet.event.EmployeeEvent;
import jtk.project4.fleet.event.EquipmentEvent;
import jtk.project4.fleet.event.FuelReceiptEvent;
import jtk.project4.fleet.event.GeneralTankInformationEvent;
import jtk.project4.fleet.event.InventoryEvent;
import jtk.project4.fleet.event.InvoiceEvent;
import jtk.project4.fleet.event.LaborEvent;
import jtk.project4.fleet.event.LastPmSetUpEvent;
import jtk.project4.fleet.event.LocationCategoryConfigurationEvent;
import jtk.project4.fleet.event.MaintenanceHistoryEvent;
import jtk.project4.fleet.event.MeterUpdateEvent;
import jtk.project4.fleet.event.NewEditScheduleEvent;
import jtk.project4.fleet.event.NewEmailNotificationEvent;
import jtk.project4.fleet.event.PMScheduleSetupEvent;
import jtk.project4.fleet.event.PMandRepairMaintenanceDueEvent;
import jtk.project4.fleet.event.POSelectionEvent;
import jtk.project4.fleet.event.PartInventoryEvent;
import jtk.project4.fleet.event.PoReceiptByInventoriedPartEvent;
import jtk.project4.fleet.event.PurchaseOrderEvent;
import jtk.project4.fleet.event.ReplacementsEvent;
import jtk.project4.fleet.event.AddScheduleRepairEvent;
import jtk.project4.fleet.event.EditTireHistoryEvent;
import jtk.project4.fleet.event.TireAssigmentEvent;
import jtk.project4.fleet.event.TireHistoryEvent;
import jtk.project4.fleet.event.TireInventoryEvent;
import jtk.project4.fleet.event.TripInformationEquipmentEvent;
import jtk.project4.fleet.event.UpdateMeterEvent;
import jtk.project4.fleet.event.UpdateMeterLogEvent;
import jtk.project4.fleet.event.VendorEvent;
import jtk.project4.fleet.event.ViewScheduleRepairEvent;
import jtk.project4.fleet.event.WorkOrderManagementEvent;
import jtk.project4.fleet.ibatis.dao.VendorsDao;
import jtk.project4.fleet.resource.i18n.ResourceLoader;
import jtk.project4.fleet.screen.AddEditPartToPurcahseOrder.AddEditPartToPurchaseOrderController;
import jtk.project4.fleet.screen.AddEditPurchaseOrder.AddEditPurchaseOrderController;
//import jtk.project4.fleet.screen.AddEditPurchaseOrder.AddEditPurchaseOrderController;
import jtk.project4.fleet.screen.AddPayment.AddPaymentController;
import jtk.project4.fleet.screen.AddTireInventory.AddTireInventoryController;
import jtk.project4.fleet.screen.addAccidentEntry.AddAccidentEntryController;
import jtk.project4.fleet.screen.addBrowsePayMent.BrowsePaymentsController;
import jtk.project4.fleet.screen.addCustomer.AddCustomerController;
//import jtk.project4.fleet.screen.addEditFuelEntry.AddEditFuelEntryController;
import jtk.project4.fleet.screen.addEditFuelEntry.AddEditFuelEntryController;
import jtk.project4.fleet.screen.addEditFuelReceipt.AddEditFuelReceiptController;
import jtk.project4.fleet.screen.addEditNewEmployee.AddEditNewEmployeeController;
import jtk.project4.fleet.screen.addEditNewEquipment.AddEditEquipmentController;
import jtk.project4.fleet.screen.addEditPartInventory.AddEditPartInventoryController;
import jtk.project4.fleet.screen.addEditVendor.AddEditVendorController;
import jtk.project4.fleet.screen.addFluidConsumed.AddFluidConsumedController;
import jtk.project4.fleet.screen.addGeneralExpense.AddGeneralExpenseController;
import jtk.project4.fleet.screen.addMaintenanceTask.AddMaintenanceTaskController;
import jtk.project4.fleet.screen.addNewCategory.AddNewCategoryController;
import jtk.project4.fleet.screen.addNewFuelTank.AddNewFuelTankController;
import jtk.project4.fleet.screen.addNewLocation.AddNewLocationController;
import jtk.project4.fleet.screen.addscheduleRepair.AddScheduleRepairController;
import jtk.project4.fleet.screen.adjustInventoryForPart.AdjustInventoryForPartController;
import jtk.project4.fleet.screen.advancedOptions.AdvancedOptionsController;
import jtk.project4.fleet.screen.autogeneratepo.AutoGeneratePOController;
import jtk.project4.fleet.screen.browsePurchaseOrder.BrowsePurchaseOrdersController;
import jtk.project4.fleet.screen.costStatistic.CostStatisticController;
import jtk.project4.fleet.screen.customerManagement.CustomerManagementController;
import jtk.project4.fleet.screen.editCompanyName.EditCompanyNameController;
import jtk.project4.fleet.screen.editMaintenanceTask.EditMaintenanceTaskController;
import jtk.project4.fleet.screen.edittirehistory.AddTireHistoryController;
import jtk.project4.fleet.screen.emailNotification.NewEmailNotificationController;
import jtk.project4.fleet.screen.employee.EmployeeController;
import jtk.project4.fleet.screen.generalTankInformation.GeneralTankInformationController;
import jtk.project4.fleet.screen.inventory.InventoryController;
import jtk.project4.fleet.screen.invoice.InvoiceController;
import jtk.project4.fleet.screen.labor.LaborController;
import jtk.project4.fleet.screen.lastPmSetUp.LastPmSetUpController;
import jtk.project4.fleet.screen.locationCategoryConfiguration.LocationCategoryConfigurationController;
import jtk.project4.fleet.screen.maintenanceHistory.MaintenanceHistoryController;
import jtk.project4.fleet.screen.meterReplacements.MeterReplacementsController;
import jtk.project4.fleet.screen.meterUpdateLog.MeterUpdateController;
//import jtk.project4.fleet.screen.newEditSchedule.newEditScheduleController;
import jtk.project4.fleet.screen.partUsed.PartUsedController;
//import jtk.project4.fleet.screen.pmScheduleSetup.pmScheduleSetupController;
//import jtk.project4.fleet.screen.pmScheduleSetup.pmScheduleSetupController;
import jtk.project4.fleet.screen.pmandRepairMaintenanceDue.PMandRepairMaintenanceDueController;
import jtk.project4.fleet.screen.poReceiptByInventoriedPart.PoReceiptByInventoriedPartController;
import jtk.project4.fleet.screen.poReceived.PurchaseOrderController;
import jtk.project4.fleet.screen.poselection.POSelectionController;
import jtk.project4.fleet.screen.tireInventory.TireInventoryController;
import jtk.project4.fleet.screen.tireHistory.TireHistoryController;
import jtk.project4.fleet.screen.tripInformationEquipment.TripInformationEquipmentController;
import jtk.project4.fleet.screen.updateMeterLog.UpdateMeterLogController;
import jtk.project4.fleet.screen.updateMeterReading.UpdateMeterController;
import jtk.project4.fleet.screen.viewScheduleRepair.ViewScheduleRepairController;
import jtk.project4.fleet.screen.viewVendor.VendorController;
import jtk.project4.fleet.screen.workOrderManagement.WorkOrderManagementController;
import jtk.project4.fleet.screen.workOrderManagement.WorkOrderManagementView;
import jtk.project4.fleet.task.LoadCustomersTask;
//import jtk.project4.fleet.task.LoadEmployeeCTask;
import jtk.project4.fleet.task.LoadHistoryTask;
//import jtk.project4.fleet.task.LoadMeterLogTask;
import jtk.project4.fleet.task.LoadFuelRecTask;
import jtk.project4.fleet.task.LoadMeterTask;
import jtk.project4.fleet.task.LoadPmHistTask;
import jtk.project4.fleet.task.LoadPoDTask;
import jtk.project4.fleet.task.LoadPoTask;
import jtk.project4.fleet.task.LoadSchDataTask;
import jtk.project4.fleet.task.LoadSchedulesTask;
//import jtk.project4.fleet.task.LoadRbDeptTask;
import jtk.project4.fleet.task.LoadTireInvTask;
import jtk.project4.fleet.task.LoadVendorTask;
import nl.coderight.jazz.Application;

public class FleetApp extends Application{
	private FleetView fleetView;
	private FleetModel fleetModel;
	
	/*
	 * Handle contact events.
	 */
	 
	/* public void handleEvent(AddAttachmentEvent evt){
		switch (evt.getType()){
		case ADD:
			fleetModel.createAttachment();
		case EDIT:
			executeController(new AddAttachmentController());
			break;
		}
	}*/
	
	public void handleEvent(EquipmentEvent evt) {
		switch (evt.getType()) {
		case ADD:
			fleetModel.createTirecfg();
		case EDIT:
			//show contact from dialog
			
			executeController(new AddEditEquipmentController());
			break;
		
		case DELETE:

			break;
		}
	}
	
	public void handleEvent(AddPaymentEvent evt) {
		switch (evt.getType()) {
		case ADD:

		case EDIT:
			//show contact from dialog
			executeController(new AddPaymentController());
			break;
		
		case DELETE:

			break;
		}
	}	
	
	public void handleEvent(WorkOrderManagementEvent evt) {
		switch (evt.getType()) {
		case VIEW:
			executeController(new WorkOrderManagementController());
			break;
		}
	}
	
	public void handleEvent(UpdateMeterLogEvent evt) {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			System.out.println("LOAD SUCCESS updateMeterLogRvent gan : " + evt.getUpdateMeterLog().get(0).getSource());
			fleetModel.setMeterLogs(evt.getUpdateMeterLog());
			break;
		case VIEW:
			System.out.println("ccd banget");
			executeController(new UpdateMeterLogController());
			break;
		}
	}

	
	
	public void handleEvent(EditTireHistoryEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddTireHistoryController());
			break;
		}
	}
	
	
	public void handleEvent(PurchaseOrderEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new PurchaseOrderController());
			break;
		}
	}
	
	
	public void handleEvent(PMandRepairMaintenanceDueEvent evt) {
		switch (evt.getType()) {
		case VIEW:
			executeController(new PMandRepairMaintenanceDueController());
			break;
		}
	}
	
	public void handleEvent(AddEditFuelEntryEvent evt) {
		switch (evt.getType()) {
		case VIEW:
			fleetModel.createFuel();
			executeController(new AddEditFuelEntryController());
			break;
		}
	}
	
	public void handleEvent(MaintenanceHistoryEvent evt) {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setHistories(evt.getMaintenanceHistory());
			break;
		case VIEW:
			executeController(new MaintenanceHistoryController());
			break;
		}
	}
	
	public void handleEvent(UpdateMeterEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new UpdateMeterController());
			break;
		}
	}
	
	public void handleEvent(MeterUpdateEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new MeterUpdateController());
			break;
		}
	}
	
	public void handleEvent(CostStatisticEvent evt) {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setPmHists(evt.getPmHists());
			break;
		/*case SELECT:
			fleetModel.setObjects(evt.getObjects());
			break;*/
		case VIEW:
			executeController(new CostStatisticController());
			break;
		}
	}
	
	public void handleEvent(AdjustInventoryForPartEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AdjustInventoryForPartController());
			break;
		}
	}
	
	
	public void handleEvent(LaborEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new LaborController());
			break;
		}
	}
	
//	public void handleEvent(ReplacementsEvent<String> evt) {
//		switch (evt.getType()) {
//		case ADD:
//			executeController(new MeterReplacementsController());
//			break;
//		}
//	}
//	

	public void handleEvent(ReplacementsEvent evt) {
		switch (evt.getType()) {
		
		case LOAD_SUCCESS:
			fleetModel.setOdometers(evt.getOdometers());
			break;
		
		case VIEW:
			executeController(new MeterReplacementsController());
			break;
		
			
		}
	}
	

	public void handleEvent(NewEmailNotificationEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new NewEmailNotificationController());
			break;
		}
	}
	
	public void handleEvent(AddFluidConsumedEvent evt) {
		switch (evt.getType()) {
		case VIEW:
			fleetModel.createFluids();
			executeController(new AddFluidConsumedController());
			break;
		}
	}
	
	
	public void handleEvent(AddGeneralExpenseEvent evt) {
		switch (evt.getType()) {
		case VIEW:
			fleetModel.createMiscExp();
			executeController(new AddGeneralExpenseController());
			break;
		}
	}
	
	public void handleEvent(TripInformationEquipmentEvent evt) {
		switch (evt.getType()) {
		case VIEW:
			executeController(new TripInformationEquipmentController());
			break;
		}
	}
	
	public void handleEvent(AddScheduleRepairEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddScheduleRepairController());
			break;
		}
	}
	
	public void handleEvent(PartInventoryEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddEditPartInventoryController());
			break;
		}
	}
	
	/*public void handleEvent(LastPmSetUpEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new LastPmSetUpController());
			break;
		}
	}
	*/
	public void handleEvent(InventoryEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new InventoryController());
			//fall-through!
			break;
		}
	}
	
	/*public void handleEvent(GeneralTankInformationEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new GeneralTankInformationController());
			//fall-through!
			break;
		}
	}*/
	
	public void handleEvent(AddNewLocationEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new AddNewLocationController());
			//fall-through!
			break;
		}
	}
	
	public void handleEvent(AddNewCategoryEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new AddNewCategoryController());
			//fall-through!
			break;
		}
	}
	
	public void handleEvent(EditCompanyNameEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new EditCompanyNameController());
			//fall-through!
			break;
		}
	}
	
	public void handleEvent(LocationCategoryConfigurationEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new LocationCategoryConfigurationController());
			//fall-through!
			break;
		}
	}
	
	
	public void handleEvent(AddPartUsedEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			fleetModel.createPartHist();
			executeController(new PartUsedController());
			//fall-through!
			break;
		}
	}
	
	public void handleEvent(PoReceiptByInventoriedPartEvent evt) {
		switch (evt.getType()) {
		
		case ADD:
			executeController(new PoReceiptByInventoriedPartController());
			//fall-through!
			break;
		}
	}
	
	public void handleEvent(EditMaintenanceTaskEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new EditMaintenanceTaskController());
			break;
		}
	}
	
	public void handleEvent(AddNewFuelTankEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddNewFuelTankController());
			break;
		}
	}
	
	public void handleEvent(GeneralTankInformationEvent evt) {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			//executeController(new GeneralTankInformationController());
			fleetModel.setFuelrecs(evt.getFuelrec());
			break;
		case VIEW:
			executeController(new GeneralTankInformationController());
			break;
		case ADD:
			executeController(new GeneralTankInformationController());
			break;
		}}
		
	public void handleEvent(ViewScheduleRepairEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new ViewScheduleRepairController());
			break;
		}
	}
	

	
	public void handleEvent(AdvancedOptionsEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AdvancedOptionsController());
			break;
		}
	}
	
	/*public void handleEvent(BrowsePaymentsEvent evt) {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setInvoices(evt.getInvoices());
			
		//case SUBMIT:
			fleetModel.setPayments(evt.getPayments());
			break;
		
		case ADD:
			executeController(new BrowsePaymentsController());
			break;
		}
	}*/
	
	public void handleEvent(BrowsePurchaseOrdersEvent evt) {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setPos(evt.getPo());
			break;
		case VIEW:
			executeController(new BrowsePurchaseOrdersController());
			break;
		}
	}
	
	public void handleEvent(AddCustomerEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddCustomerController());
			break;
		}
	}
	
	public void handleEvent(LastPmSetUpEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new LastPmSetUpController());
			break;
		}
	}

	public void handleEvent(AccidentEntryEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddAccidentEntryController());
			break;
		}
	}
	public void handleEvent(AddEditPurchaseOrderEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddEditPurchaseOrderController());
			break;
			
		case LOAD_SUCCESS:
			fleetModel.setPoDs(evt.getPoDs());
		/*case EDIT:
			executeController(new EditAccidentEntryController());*/
		}
	}
	
	public void handleEvent(AddEditPartToPurchaseOrderEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddEditPartToPurchaseOrderController());
			break;
		/*case EDIT:
			executeController(new EditAccidentEntryController());*/
		}
	}
	
	public void handleEvent(FuelReceiptEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AddEditFuelReceiptController());
			break;
		}
	}
	
	public void handleEvent(AutoGeneratePOEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new AutoGeneratePOController());
			break;
		}
	}
	
	public void handleEvent(POSelectionEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new POSelectionController());
			break;
		}
	}
	
	public void handleEvent(InvoiceEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new InvoiceController());
			break;
		}
	}
	
	public void handleEvent(TireHistoryEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new TireHistoryController());
			break;
		}
	}
	
	public void handleEvent(TireAssigmentEvent evt) {
		switch (evt.getType()) {
		case ADD:
			executeController(new TireInventoryController());
			break;
		}
	}

	
	public void handleEvent(TireInventoryEvent evt) throws SQLException{
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setTireInvs(evt.getTireinvs());
			System.out.print("load suses");
			break;
		case ADD:
			fleetModel.createTireInv();
		    //$FALL-THROUGH$*/
		case EDIT:
			// show vendor form dialog
			executeController(new AddTireInventoryController());
			break;
		case VIEW:
			executeController(new TireInventoryController());
			break;
		case DELETE:
			fleetModel.deleteTireInv(fleetModel.getTireInv());
			break;
		}
		
	}
	
	public void handleEvent(VendorEvent evt) throws SQLException {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setVendors(evt.getVendors());
			break;
		case ADD:
			fleetModel.createVendor();
		    //$FALL-THROUGH$
		case EDIT:
			// show vendor form dialog
			executeController(new AddEditVendorController());
			break;
		case VIEW:
			executeController(new VendorController());
			break;
		case DELETE:
			fleetModel.deleteVendor(fleetModel.getVendor());
			break;
		}
	}
	

	
	public void handleEvent(CustomerManagementEvent evt) throws SQLException {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
			fleetModel.setCustomers(evt.getCustomers());
			break;
		case ADD:
			fleetModel.createCustomers();
			System.out.println("ADD");
		case EDIT:
			// show vendor form dialog
			executeController(new AddCustomerController());
			break;
		case VIEW:
			executeController(new CustomerManagementController());
			break;
		case DELETE:
			fleetModel.deleteCustomers(fleetModel.getCustomer());
			break;
		}
	}
		
	public void handleEvent(AddMaintenanceTaskEvent evt) {
		switch (evt.getType()) {
		case ADD:
			fleetModel.createPmHist();
			executeController(new AddMaintenanceTaskController());
			break;
		}
	}
	
	public void handleEvent(EmployeeEvent evt) throws SQLException {
		switch (evt.getType()) {
		case LOAD_SUCCESS:
		//	fleetModel.setEmployees(evt.getEmployees());
			break;
		case ADD:
			fleetModel.createEmployee();
		    //$FALL-THROUGH$
		case EDIT:
			// show vendor form dialog
			executeController(new AddEditNewEmployeeController());
			break;
		case VIEW:
			executeController(new EmployeeController());
			break;
		/*case DELETE:
			fleetModel.deleteVendor(fleetModel.getVendor());
			break;*/
		}
	}
	
	
	public void handleEvent(PMScheduleSetupEvent evt) throws SQLException {
		switch (evt.getType()) {
		case ADD:
			executeController(new pmScheduleSetupController());
			break;
		case LOAD_SUCCESS:
			fleetModel.setSchedules(evt.getSchedules());
			break;
		case VIEW:
			executeController(new pmScheduleSetupController());
			break;
		}
	}
	
	public void handleEvent(NewEditScheduleEvent evt) {
		switch (evt.getType()) {
		case ADD:
			fleetModel.createSchedule();
			executeController(new newEditScheduleController());
			break;
		case LOAD_SUCCESS:
			fleetModel.setSchedules(evt.getSchedules());
			break;
		case VIEW:
			executeController(new newEditScheduleController());
			break;
		}
	}
	public void handleEvent(AddNewFuelTankEvent evt) {
		switch (evt.getType()) {
		case ADD:
			fleetModel.createFuelTank();
			executeController(new AddNewFuelTankController());
			break;
		}
	}
	
	@Override
	public void init() {
		// TODO Auto-generated method stub
		setResourceManager(new ResourceLoader("jtk/project4/fleet/resource/i18n/language"));
	}
	
	@Override
	protected void onAfterShowView() {
		super.onAfterShowView();
		executeTask(new LoadTireInvTask());
		executeTask(new LoadVendorTask());
		//executeTask(new LoadEmployeeTask());
		executeTask(new LoadCustomersTask());
		executeTask(new LoadPoTask());
		executeTask(new LoadHistoryTask());
		//executeTask(new LoadRbDeptTask());
		executeTask(new LoadPoDTask());
		executeTask(new LoadFuelRecTask());
		executeTask(new LoadMeterTask());
		executeTask(new LoadPmHistTask());

		//executeTask(new LoadMeterLogTask());
		//executeTask(new LoadEmployeeCTask());
		executeTask(new LoadSchDataTask());
		executeTask(new LoadSchedulesTask());
	}
	

	@Override
	public void execute() {
		fleetModel = new FleetModel();
		fleetView= new FleetView();
		setModel(fleetModel);
		setView(fleetView);
		showView();
	}
	
	public static void main(String[] args){
		new FleetApp().start();
	}

}
